# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2023年02月23日
"""
import docx

# from docx.enum.text import WD_ALIGN_PARAGRAPH

myDocument = docx.Document('年度收入.docx')
myTable = myDocument.tables[0]
for i in range(1, len(myTable.rows)):
	mySum = 0
	for j in range(2, len(myTable.columns) - 1):
		mySum += int(myTable.row_cells(i)[j].text)
		myTable.row_cells(i)[4].text = str(mySum)

myDocument.save("02散文名篇.docx")
